import { createAsyncThunk } from '@reduxjs/toolkit';
import { apiUserInfo } from '@/api/user';
import { apiGetRandomWall } from '@/api/home';

// 定义异步操作
export const fetchUser = createAsyncThunk(
  'users/fetchUser', // action 类型前缀
  async () => {
    const response = await apiUserInfo();
    return response; // 返回成功时的数据
  }
);

// 定义异步操作
export const fetchRandomWall = createAsyncThunk(
  'users/fetchRandomWall', // action 类型前缀
  async () => {
    const response = await apiGetRandomWall();
    return response; // 返回成功时的数据
  }
);
